<html>
<head><meta charset="utf-8"><title>Cannot run custom fork of rustdoc built out-of-tree · rustdoc · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/index.html">rustdoc</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Cannot.20run.20custom.20fork.20of.20rustdoc.20built.20out-of-tree.html">Cannot run custom fork of rustdoc built out-of-tree</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="218158718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Cannot%20run%20custom%20fork%20of%20rustdoc%20built%20out-of-tree/near/218158718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Cannot.20run.20custom.20fork.20of.20rustdoc.20built.20out-of-tree.html#218158718">(Nov 28 2020 at 10:44)</a>:</h4>
<p>I took librustdoc as a base, modified <code>run_global_ctxt()</code> to call my custom analysis.</p>
<p>When I run it on a single file, it works perfectly:</p>
<div class="codehilite" data-code-language="Bash"><pre><span></span><code>cargo run -- somefile.rs
</code></pre></div>
<p>However, if I try to run with cargo-doc, I get:</p>
<div class="codehilite" data-code-language="Bash"><pre><span></span><code><span class="nv">RUST_BACKTRACE</span><span class="o">=</span><span class="m">1</span> <span class="nv">RUSTDOC</span><span class="o">=</span>target/release/cargo-callgraph cargo doc
warning: output filename collision.
The lib target <span class="sb">`</span>crossbeam-utils<span class="sb">`</span> in package <span class="sb">`</span>crossbeam-utils v0.7.2<span class="sb">`</span> has the same output filename as the lib target <span class="sb">`</span>crossbeam-utils<span class="sb">`</span> in package <span class="sb">`</span>crossbeam-utils v0.6.6<span class="sb">`</span>.
Colliding filename is: /home/robin/dev/cargo-callgraph/target/doc/crossbeam_utils/index.html
The targets should have unique names.
This is a known bug where multiple crates with the same name use
the same path<span class="p">;</span> see &lt;https://github.com/rust-lang/cargo/issues/6313&gt;.
 Documenting crossbeam-queue v0.1.2
error: could not document <span class="sb">`</span>crossbeam-queue<span class="sb">`</span>

Caused by:
  could not execute process <span class="sb">`</span>/home/robin/dev/cargo-callgraph/target/release/cargo-callgraph --crate-type lib --crate-name crossbeam_queue /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-queue-0.1.2/src/lib.rs --cap-lints allow -o /home/robin/dev/cargo-callgraph/target/doc --error-format<span class="o">=</span>json --json<span class="o">=</span>diagnostic-rendered-ansi -L <span class="nv">dependency</span><span class="o">=</span>/home/robin/dev/cargo-callgraph/target/debug/deps --extern <span class="nv">crossbeam_utils</span><span class="o">=</span>/home/robin/dev/cargo-callgraph/target/debug/deps/libcrossbeam_utils-dc839f467baf84df.rmeta --crate-version <span class="m">0</span>.1.2<span class="sb">`</span> <span class="o">(</span>never executed<span class="o">)</span>

Caused by:
  No such file or directory <span class="o">(</span>os error <span class="m">2</span><span class="o">)</span>
</code></pre></div>
<p>I don't know how to what is the cause of the error, (<code>cargo --verbose doc</code> didn't help).</p>



<a name="218161812"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Cannot%20run%20custom%20fork%20of%20rustdoc%20built%20out-of-tree/near/218161812" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Cannot.20run.20custom.20fork.20of.20rustdoc.20built.20out-of-tree.html#218161812">(Nov 28 2020 at 12:16)</a>:</h4>
<p>There is a way by using rustup to set where rustdoc binary is, then you use <code>cargo +local</code> or something along the line. Let me find it again</p>



<a name="218162180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Cannot%20run%20custom%20fork%20of%20rustdoc%20built%20out-of-tree/near/218162180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Cannot.20run.20custom.20fork.20of.20rustdoc.20built.20out-of-tree.html#218162180">(Nov 28 2020 at 12:27)</a>:</h4>
<p><span class="user-mention" data-user-id="281841">@Robin Moussu</span> like this: <code>rustup toolchain link local /path/to/build/$TARGET/stage1</code></p>



<a name="218162181"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Cannot%20run%20custom%20fork%20of%20rustdoc%20built%20out-of-tree/near/218162181" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Cannot.20run.20custom.20fork.20of.20rustdoc.20built.20out-of-tree.html#218162181">(Nov 28 2020 at 12:27)</a>:</h4>
<p>then you can use <code>cargo +local doc</code></p>



<a name="218162182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Cannot%20run%20custom%20fork%20of%20rustdoc%20built%20out-of-tree/near/218162182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Cannot.20run.20custom.20fork.20of.20rustdoc.20built.20out-of-tree.html#218162182">(Nov 28 2020 at 12:27)</a>:</h4>
<p><span class="user-mention" data-user-id="281841">@Robin Moussu</span> that looks like you forgot to run <code>cargo build</code> after a change</p>



<a name="218162187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Cannot%20run%20custom%20fork%20of%20rustdoc%20built%20out-of-tree/near/218162187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Cannot.20run.20custom.20fork.20of.20rustdoc.20built.20out-of-tree.html#218162187">(Nov 28 2020 at 12:27)</a>:</h4>
<p><span class="user-mention" data-user-id="210316">@GuillaumeGomez</span> that won't help here because the binary isn't called 'rustdoc'</p>



<a name="218162235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Cannot%20run%20custom%20fork%20of%20rustdoc%20built%20out-of-tree/near/218162235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Cannot.20run.20custom.20fork.20of.20rustdoc.20built.20out-of-tree.html#218162235">(Nov 28 2020 at 12:28)</a>:</h4>
<p>that's what I always used to test things until now, so maybe I just didn't understand the problem XD</p>



<a name="218162256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Cannot%20run%20custom%20fork%20of%20rustdoc%20built%20out-of-tree/near/218162256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Cannot.20run.20custom.20fork.20of.20rustdoc.20built.20out-of-tree.html#218162256">(Nov 28 2020 at 12:28)</a>:</h4>
<p>Yes, what happened is Robin forked the rustdoc project and is using it to generate callgraphs, not documentation</p>



<a name="218162265"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Cannot%20run%20custom%20fork%20of%20rustdoc%20built%20out-of-tree/near/218162265" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> GuillaumeGomez <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Cannot.20run.20custom.20fork.20of.20rustdoc.20built.20out-of-tree.html#218162265">(Nov 28 2020 at 12:28)</a>:</h4>
<p>Oh I see</p>



<a name="218162268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Cannot%20run%20custom%20fork%20of%20rustdoc%20built%20out-of-tree/near/218162268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Cannot.20run.20custom.20fork.20of.20rustdoc.20built.20out-of-tree.html#218162268">(Nov 28 2020 at 12:29)</a>:</h4>
<p>So he also changed the name, so cargo can't find it anymore, but he still wants to have the info from dependencies, so instead he's tricking cargo into thinking the fork is still rustdoc</p>



<a name="218167301"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Cannot%20run%20custom%20fork%20of%20rustdoc%20built%20out-of-tree/near/218167301" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Cannot.20run.20custom.20fork.20of.20rustdoc.20built.20out-of-tree.html#218167301">(Nov 28 2020 at 14:51)</a>:</h4>
<p>It's exactly that. However I did not forgot to <code>cargo build</code>.</p>



<a name="218167352"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Cannot%20run%20custom%20fork%20of%20rustdoc%20built%20out-of-tree/near/218167352" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Cannot.20run.20custom.20fork.20of.20rustdoc.20built.20out-of-tree.html#218167352">(Nov 28 2020 at 14:52)</a>:</h4>
<p>if you run <code>/home/robin/dev/cargo-callgraph/target/release/cargo-callgraph --help</code> does that work?</p>



<a name="218167503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Cannot%20run%20custom%20fork%20of%20rustdoc%20built%20out-of-tree/near/218167503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Cannot.20run.20custom.20fork.20of.20rustdoc.20built.20out-of-tree.html#218167503">(Nov 28 2020 at 14:56)</a>:</h4>
<p><span class="user-mention" data-user-id="281841">@Robin Moussu</span> ^</p>



<a name="218167795"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Cannot%20run%20custom%20fork%20of%20rustdoc%20built%20out-of-tree/near/218167795" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Cannot.20run.20custom.20fork.20of.20rustdoc.20built.20out-of-tree.html#218167795">(Nov 28 2020 at 15:02)</a>:</h4>
<p><span aria-label="face palm" class="emoji emoji-1f926" role="img" title="face palm">:face_palm:</span> I did not use the right command from my history… I only build the debug version, and though that I asked the debug version with <code>cargo doc</code></p>



<a name="218167872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Cannot%20run%20custom%20fork%20of%20rustdoc%20built%20out-of-tree/near/218167872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Cannot.20run.20custom.20fork.20of.20rustdoc.20built.20out-of-tree.html#218167872">(Nov 28 2020 at 15:04)</a>:</h4>
<p>personally I use a <code>run.sh</code> for things like this, where literally all it does is <code>cargo build &amp;&amp; &lt;the run command&gt;</code></p>



<a name="218167876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Cannot%20run%20custom%20fork%20of%20rustdoc%20built%20out-of-tree/near/218167876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Cannot.20run.20custom.20fork.20of.20rustdoc.20built.20out-of-tree.html#218167876">(Nov 28 2020 at 15:04)</a>:</h4>
<p>for when <code>cargo run</code> isn't smart enough for what I want to do</p>



<a name="218167884"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Cannot%20run%20custom%20fork%20of%20rustdoc%20built%20out-of-tree/near/218167884" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Cannot.20run.20custom.20fork.20of.20rustdoc.20built.20out-of-tree.html#218167884">(Nov 28 2020 at 15:04)</a>:</h4>
<p>(deleted)</p>



<a name="218167979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Cannot%20run%20custom%20fork%20of%20rustdoc%20built%20out-of-tree/near/218167979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Cannot.20run.20custom.20fork.20of.20rustdoc.20built.20out-of-tree.html#218167979">(Nov 28 2020 at 15:07)</a>:</h4>
<p>^^</p>



<a name="218167984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Cannot%20run%20custom%20fork%20of%20rustdoc%20built%20out-of-tree/near/218167984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Cannot.20run.20custom.20fork.20of.20rustdoc.20built.20out-of-tree.html#218167984">(Nov 28 2020 at 15:07)</a>:</h4>
<p>anyway, this means that the original bug I had still exists <span aria-label="sad" class="emoji emoji-2639" role="img" title="sad">:sad:</span></p>
<p><a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60">https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>